package com.reportgenerate.marketreport.service;

/**
 * @program: reportgenerate
 * @Description: RowBounds与Page中进行一个 page to offset和size to limit 的转换
 * （Integer offset = (page - 1) * size;Integer limit = size;）
 * @author: Mr.Cheng
 * @date: 2023/8/20 19:45
 */
public interface RowBoundsToPage {
    /**
    * @Description: page to offset
    * @Param: [page]
    * @return: java.lang.Integer
    * @Author: Mr.Cheng
    * @Email: ccelephant_518@126.com
    * @Date: 2023/8/20 19:53
    */
    public Integer offset(Integer page, Integer size);

    /**
    * @Description: size to limit
    * @Param: [size]
    * @return: java.lang.Integer
    * @Author: Mr.Cheng
    * @Email: ccelephant_518@126.com
    * @Date: 2023/8/20 19:53
    */
    public Integer limit(Integer size);

    /**
    * @Description: 获取页数
    * @Param: [offset, size]
    * @return: java.lang.Integer
    * @Author: Mr.Cheng
    * @Email: ccelephant_518@126.com
    * @Date: 2023/8/22 23:39
    */
    public Integer getPage(Integer offset, Integer size);
}
